<!DOCTYPE html>
<html lang="en">
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/resource/common/layui/css/layui.css">
    <link rel="stylesheet" href="/resource/js/front/index.css">
</head>
<style>
    #house-user-orderDetails + div td .layui-table-cell {
        height: 78px;
        line-height: 79px;
    }
</style>
<body>
<div th:replace="front/head :: heads"></div>
<div class="layui-container userpublic house-userPer">
    <div class="layui-row layui-col-space20">
        <p class="layui-hide-xs title">首页 &gt; <span> </span></p>
        <div th:replace="front/head :: info-nav"></div>
        <div class="layui-col-sm10">
            <div class="layui-tab layui-tab-brief">
                <div class="layui-tab-content">
                    <div class="layui-tab-item" style="display: block">
                        <fieldset class="layui-elem-field layui-field-title">
                            <legend>订单详情</legend>
                            <div class="layui-field-box">
                                <table id="house-user-orderDetails" lay-filter="house-user-orderDetails"></table>
                            </div>
                        </fieldset>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/html" id="goodsTpl">
    <div>
        <img src="{{d.avatar}}" style="height: 100px">
        <div style="display: inline-block; text-align: left; vertical-align: top;">
            <p>{{d.name}}&nbsp;&nbsp;&nbsp;{{d.color}}</p>
        </div>
    </div>
</script>
<script type="text/html" id="priceTpl">
    <p><span class="price">￥{{d.price}}</span></p>
</script>
<script type="text/html" id="numTpl">
    <div class="">
        <p><span>{{d.number}}</span>
        </p>
    </div>
</script>
<script type="text/html" id="totalTpl">
    <span class="total" style="color: #cd2d15;">￥{{(d.price*d.number).toFixed(2)}}</span>
</script>
<script type="text/javascript" src="/resource/common/layui/layui.js"></script>
<script type="text/javascript" src="/resource/js/front/house.js"></script>
<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script th:inline="javascript">
    layui.use(['table', 'layer', 'laydate', 'form'], function () {
        var table = layui.table,
            $ = layui.$,
            layer = layui.layer,
            form = layui.form
        var orderId = [[${orderId}]]
        table.render({
            elem: '#house-user-orderDetails'
            , url: '/front/orderDetailsTable.do' //数据接口
            , method: 'get'
            , page: true //开启分页
            , id: 'tableId'
            , where: {'orderId': orderId}
            , limits: [10, 15, 30]
            , limit: 15
            , cols: [
                [ //表头
                    {title: '商品', align: 'center', width: 400, templet: '#goodsTpl'}
                    , {title: '单价', align: 'center', templet: '#priceTpl'}
                    , {title: '数量', align: 'center', templet: '#numTpl'}
                    , {title: '小计', align: 'center', templet: '#totalTpl'}
                ]
            ]
        });
    });
</script>

</body>
</html>